package javase.reflection.spies;

import java.lang.reflect.Method;

import javase.reflection.Specific;

public class MethodSpy {
	public static void main(String[] args) {
		Object object = new Specific();
		System.out.println("getDeclaredMethods: ");
		printMethods(object.getClass().getDeclaredMethods());
		System.out.println("getMethods: ");
		printMethods( object.getClass().getMethods());
	}
	
	private static void printMethods(Method[] methods) {
		for (Method method : methods) {
			System.out.println(method.toGenericString());
		}
		System.out.println("");
	}

}
